#ifndef KEYBOARD_H_INCLUDED
#define KEYBOARD_H_INCLUDED

#include "types.h"
#include "window.h"

class Keyboard : public Instance, public Singleton<Keyboard>
{
    public:
        Keyboard(const string& name = "Untitled", ClassId* classId = sClassId);
        virtual ~Keyboard();

        static void startTextInput();
        static void stopTextInput();

        // Event handling
        static void handleKeyEvent(SDL_KeyboardEvent* event, float dt);
        virtual void onKeyDown(Window* window, SDL_Keysym keysym, bool isRepeat, float dt);
        virtual void onKeyUp(Window* window, SDL_Keysym keysym, float dt);
        static void handleTextInputEvent(SDL_TextInputEvent* event, float dt);
        virtual void onTextInput(Window* window, char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]);

        // Instance
        DECLARE_CLASSID(Keyboard);
        virtual bool load(DataStream* ds = 0);
        virtual bool save(DataStream* ds = 0);

    private:
};

#endif // KEYBOARD_H_INCLUDED
